function effectogram = crossCorrelation2D(template, signal)
%CROSSCORRELATION2D calculates 2D cross correlation for given signal and
%template. Scales useless sides added by xcorr2 function 
effectogram = xcorr2(signal, template);
templateSize = size(template);
effectogram = effectogram(templateSize(1) :end - templateSize(1) + 1, templateSize(2) :end - templateSize(2) + 1);
effectogram = effectogram / max(max(effectogram));
correlation2DMean = mean(mean(effectogram));
effectogram = scale2DEffectogram(effectogram - correlation2DMean, templateSize, size(signal), 0);
end

